package array;

import java.util.Scanner;

public class ReverseArray {
    static Scanner stdIn=new Scanner(System.in);

    static void swap(int[] a,int idx1,int idx2){
        int t=a[idx1];
        a[idx1]=a[idx2];
        a[idx2]=t;
    }

    static void reverse(int[] a){
        for (int i = 0; i <a.length/2 ; i++) {
            swap(a,i,a.length-i-1);
        }
    }

    public static void main(String[] args) {
        int num=stdIn.nextInt();
        int[] x=new int[num];
        for (int i = 0; i <x.length ; i++) {
            System.out.print("a["+i+"]=");
            x[i]=stdIn.nextInt();
        }

        reverse(x);
        System.out.println("元素倒数排序执行完毕！");
        for (int i = 0; i <num ; i++) {
            System.out.println(x[i]);

        }

    }


}
